<html>
<head>

<meta charset="UTF-8">
<title>Mua~亲亲宠————宠物交易领养信息平台</title>
<!-- Bootstrap core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Bootstrap theme -->
<link href="css/bootstrap-theme.min.css" rel="stylesheet">
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
	<div>
		<nav class="navbar navbar-default  navbar-fixed-top">
			<div class="container-fluid">
				<div>
					<ul class="nav navbar-nav">
						<li><a href="user/home.do">首&nbsp;&nbsp;页</a></li>
						<li><a href="#">猫&nbsp;&nbsp;猫</a></li>
						<li><a href="#"> 狗&nbsp;&nbsp;狗</a></li>
						<li class="dropdown"><a href="#" class="dropdown-toggle"
							data-toggle="dropdown"> 猫猫 <b class="caret"></b> </a>
							<ul class="dropdown-menu">
								<li><a href="#">jmeter</a></li>
								<li><a href="#">EJB</a></li>
								<li><a href="#">Jasper Report</a></li>
								<li class="divider"></li>
								<li><a href="#">分离的链接</a></li>
								<li class="divider"></li>
								<li><a href="#">另一个分离的链接</a></li>
							</ul>
						</li>
					</ul>
					<ul class="nav navbar-nav navbar-right">
						<li><a href="#">注销</a>
						</li>
					</ul>
				</div>
			</div>
		</nav>
	</div>
	<div align="left" style="height: 50px"></div>
	<div class="title">
		<div class="search">
			<div class="input-group">
				<input type="text" class="form-control"> <span
					class="input-group-btn">
					<button class="btn btn-info" type="button">搜索</button> </span>
			</div>
			<div class="hot">
				热门搜索：<a href="#">热门1</a><a href="#">热门2</a><a href="#">热门3</a><a
					href="#">热门4</a><a href="#">热门5</a>
			</div>
		</div>
	</div>

	<div>
		<div id="welcome" class="col-md-4 panel">
			<div class="col-sm-offset-4" style="font-size: 24px; ">欢迎！</div>
			<div id="un_login">
				<div class="col-sm-offset-3 col-sm-3">
					<a href="login.html"><button type="button" class="btn btn-info">登录</button>
					</a>
				</div>
				<div class="col-sm-offset- col-sm-3">
					<a href="register.html"><button type="button"
							class="btn btn-info">注册</button> </a>
				</div>
			</div>
		</div>
		<div id="newest_pets" class="col-sm-8 row container"></div>
	</div>
	<script type="text/javascript">
		$(document).ready(function() {
			onload();
		});
		function onload() {
			$
					.ajax({
						url : "pet/listNewestPet.do",
						success : function(result) {
							if (result.msg == 'success') {
								var list = result.petList;
								var innerText = "";
								for (var no in list) {
								if(list[no].icon == null || list[no].icon == "")
								{
								list[no].icon = "images/pet_icon.jpg";
								}
									innerText = innerText
											+ " <div class='col-sm-4'> <div class='thumbnail' style='height: 200px'><img src='"
											+list[no].icon+"' alt='"+list[no].title
											+"'  class='img-responsive'><div class='caption'><h4>"
											+ list[no].title + "</h4><p>"
											+ list[no].description
											+ "</p></div></div></div>";
								}
								$("#newest_pets")
										.html(innerText);
							} else {
								$("#newest_pets")
										.html(
												"<button  class='btn btn-info' onclick='onload()'>重新加载</button>");
							}

						}

					});
		}
	</script>
</body>
</html>